unit fusuariobusca;

{$mode objfpc}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, DBGrids, Buttons, ExtCtrls, dmprincipal;

type

  { TFormUsuarioBusca }

  TFormUsuarioBusca = class(TForm)
    ButtonSair: TBitBtn;
    ButtonLimpar: TBitBtn;
    ButtonLocalizar: TBitBtn;
    DBGrid1: TDBGrid;
    EditNome: TEdit;
    EditLogin: TEdit;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    Label3: TLabel;
    procedure ButtonLimparClick(Sender: TObject);
    procedure ButtonLocalizarClick(Sender: TObject);
    procedure ButtonSairClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  FormUsuarioBusca: TFormUsuarioBusca;

implementation

uses  ucondicoesconsulta, dmusuario;

{ TFormUsuarioBusca }

procedure TFormUsuarioBusca.ButtonLocalizarClick(Sender: TObject);
var
  condicoes: TCondicoesConsulta;
begin
  condicoes := TCondicoesConsulta.Create(CON_AND);
  condicoes.AddText('nome_usuario', EditNome.Text);
  condicoes.AddText('login_usuario', EditLogin.Text);
  DataPrincipal.ConsultaCondicoes(DataUsuario.ZQueryUsuario, 'usuario', condicoes);
end;

procedure TFormUsuarioBusca.ButtonLimparClick(Sender: TObject);
begin
  EditLogin.Clear();
  EditNome.Clear();
end;

procedure TFormUsuarioBusca.ButtonSairClick(Sender: TObject);
begin
  Close();
end;

initialization
  {$I fusuariobusca.lrs}

end.
